import { Entity, PrimaryGeneratedColumn, Column, Unique } from "typeorm";
import { ManualTimestamp } from "../decorators/manual-timestamp.decorator";

@Entity("deputy_attribute_points")
@ManualTimestamp()
@Unique(["deputyId"])
export class DeputyAttributePointsEntity {
  @PrimaryGeneratedColumn()
  id!: number;

  @Column("int", { name: "deputyId", comment: "副将ID" })
  deputyId!: number;

  @Column("int", { default: 0, comment: "力量已分配" })
  strength!: number;

  @Column("int", { default: 0, comment: "体质已分配" })
  constitution!: number;

  @Column("int", { default: 0, comment: "智力已分配" })
  intelligence!: number;

  @Column("int", { default: 0, comment: "敏捷已分配" })
  agility!: number;

  @Column("int", { default: 0, comment: "可用未分配点数" })
  availablePoints!: number;

  @Column("datetime", { name: "created_at", comment: "创建时间" })
  created_at!: Date;

  @Column("datetime", {
    name: "updated_at",
    nullable: true,
    comment: "更新时间",
  })
  updated_at!: Date | null;
}
